package com.woniuxy.vuecli.controller;

import com.woniuxy.vuecli.entity.Department;
import com.woniuxy.vuecli.entity.ResponseResult;
import com.woniuxy.vuecli.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author author
 * @Create 2024-01-15 10:09
 */
//@CrossOrigin
@RequestMapping("/department")
@RestController
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;


    @RequestMapping("/getAll")
    public ResponseResult<List<Department>> getAll(){
        return new ResponseResult<>(200,"ok",departmentService.getAll());
    }
}
